<?php

namespace STAGE\StageBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * Document
 *
 * @ORM\Table()
 * @ORM\Entity(repositoryClass="STAGE\StageBundle\Entity\DocumentRepository")
 */
class Document {

    /**
     * @var integer
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @var string
     *
     * @ORM\Column(name="nom", type="string", length=255)
     */
    private $nom;

    /**
     * @var string
     *
     * @ORM\Column(name="chemin", type="string", length=255)
     */
    private $chemin;

    /**
     * @var \DateTime
     *
     * @ORM\Column(name="date_depot", type="date")
     */
    private $dateDepot;

    /**
     *
     * @ORM\OneToMany(targetEntity="STAGE\StageBundle\Entity\Commentaire",mappedBy="document")
     */
    private $commentaires;

    /**
     *
     * @ORM\ManyToOne(targetEntity="STAGE\UserBundle\Entity\User",inversedBy="documents")
     */
    private $user;
    /**
     *
     * @ORM\ManyToOne(targetEntity="STAGE\StageBundle\Entity\Stage",inversedBy="documents")
     */
    private $stage;

    /**
     * Get id
     *
     * @return integer 
     */
    public function getId() {
        return $this->id;
    }

    /**
     * Set nom
     *
     * @param string $nom
     * @return Document
     */
    public function setNom($nom) {
        $this->nom = $nom;

        return $this;
    }

    /**
     * Get nom
     *
     * @return string 
     */
    public function getNom() {
        return $this->nom;
    }

    /**
     * Set chemin
     *
     * @param string $chemin
     * @return Document
     */
    public function setChemin($chemin) {
        $this->chemin = $chemin;

        return $this;
    }

    /**
     * Get chemin
     *
     * @return string 
     */
    public function getChemin() {
        return $this->chemin;
    }

    /**
     * Set dateDepot
     *
     * @param \DateTime $dateDepot
     * @return Document
     */
    public function setDateDepot($dateDepot) {
        $this->dateDepot = $dateDepot;

        return $this;
    }

    /**
     * Get dateDepot
     *
     * @return \DateTime 
     */
    public function getDateDepot() {
        return $this->dateDepot;
    }

    /**
     * Constructor
     */
    public function __construct()
    {
        $this->commentaires = new \Doctrine\Common\Collections\ArrayCollection();
    }

    /**
     * Add commentaires
     *
     * @param \STAGE\StageBundle\Entity\Commentaire $commentaires
     * @return Document
     */
    public function addCommentaire(\STAGE\StageBundle\Entity\Commentaire $commentaires)
    {
        $this->commentaires[] = $commentaires;

        return $this;
    }

    /**
     * Remove commentaires
     *
     * @param \STAGE\StageBundle\Entity\Commentaire $commentaires
     */
    public function removeCommentaire(\STAGE\StageBundle\Entity\Commentaire $commentaires)
    {
        $this->commentaires->removeElement($commentaires);
    }

    /**
     * Get commentaires
     *
     * @return \Doctrine\Common\Collections\Collection 
     */
    public function getCommentaires()
    {
        return $this->commentaires;
    }

    /**
     * Set user
     *
     * @param \STAGE\UserBundle\Entity\User $user
     * @return Document
     */
    public function setUser(\STAGE\UserBundle\Entity\User $user = null)
    {
        $this->user = $user;

        return $this;
    }

    /**
     * Get user
     *
     * @return \STAGE\UserBundle\Entity\User 
     */
    public function getUser()
    {
        return $this->user;
    }

    /**
     * Set stage
     *
     * @param \STAGE\StageBundle\Entity\Stage $stage
     * @return Document
     */
    public function setStage(\STAGE\StageBundle\Entity\Stage $stage = null)
    {
        $this->stage = $stage;

        return $this;
    }

    /**
     * Get stage
     *
     * @return \STAGE\StageBundle\Entity\Stage 
     */
    public function getStage()
    {
        return $this->stage;
    }
}
